/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nc.solutions.rentacar.domain.Money.util;

import com.nc.solutions.rentacar.domain.Money.util.MoneyException;

/**
 *
 * @author Andrey
 */
public enum Currency {
	USD,EUR,RUB;
	public double get() throws MoneyException{
		switch(this){
			case USD:
				return 1.3;
			case EUR:
				return 1;
			case RUB:
				return 0.033;
			default:
				throw new MoneyException("no coefficient for currency");
		}
	}
	public double getConvertRate(Currency cur) throws MoneyException{
		return cur.get() / this.get();
	}
}
